pushName method
Append a name
*/
Implementation
void pushName(String s) {
charToSymbol(int c) {
if (c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0)) {
return (c - 'a'.codeUnitAt(0)) + 6;
}
if (c >= '1'.codeUnitAt(0) && c <= '5'.codeUnitAt(0)) {
return (c - '1'.codeUnitAt(0)) + 1;
}
return 0;
}
var a = new Uint8List(8);
var bit = 63;
for (var i = 0; i < s.length; ++i) {
var c = charToSymbol(s.codeUnitAt(i));
if (bit < 5) {
c = c << 1;
}
for (var j = 4; j >= 0; --j) {
if (bit >= 0) {
a[(bit / 8).floor()] |= ((c >> j) & 1) << (bit % 8);
--bit;
}
}
}
pushArray(a);
}