?? nbe.cpp
字號:
// Created:10-24-98
// By Jeff Connelly
// NBEncoding (nibble-byte encoding)
// Converts binary to plain text, like UUE and HEX
// A byte is splitted into two bytes, thus:
// a and b are nibbles, f is a fixed nibble that is always the same
// ab -> fafb
// Example help:
// Data: 1010 0101
// high low
//
// Encoded: 0100 1010 0100 0101
// FIXED high FIXED low
//
// The 'fixed' bytes are always the same.
#include "stdafx.h"
#define EXPORTING
#include "comprlib.h"
void EXPORT nb_encode()
{
register char c; // Character
register char h, l; // High and low nibbles
const char fixed = 4; // Fixed nibble = 0100
while (!end_of_data())
{
c = read_byte();
// Isolate the nibbles
h = c & 0xF0;
l = c & 0x0F;
// Apply 'fixed' constent
h |= fixed;
l |= fixed;
write_byte(h);
write_byte(l);
}
}
void EXPORT nb_decode()
{
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -