This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reverse(array) { | |
var copy = array.slice(); | |
copy.reverse(); | |
return copy; | |
} | |
function gray(nbits) { | |
if (nbits <= 0) return ['']; // zero bit code contains 2^0 values == 1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on: https://github.com/bsimic0001/AegisWallet/blob/master/mobile/src/main/java/com/aegiswallet/utils/MessagingUtils.java | |
public class MessagingUtils { | |
public static void main(String[] args) { | |
System.out.println("encode: " + encode("*100#")); | |
System.out.println("decode: " + decode("<<message to decode>>")); | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const NKEYS = 4; | |
function arrayOfSize(size) { | |
var a = Array(size); | |
for (var i = 0; i < size; i += 1) | |
a[i] = null; |
OlderNewer