Skip to content

Instantly share code, notes, and snippets.

@mrdomino
Created October 21, 2021 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrdomino/d6fa86389f8c727fa2c4af43929f79e7 to your computer and use it in GitHub Desktop.
Save mrdomino/d6fa86389f8c727fa2c4af43929f79e7 to your computer and use it in GitHub Desktop.
print 16 random @ps under a given star
// requires urbit-ob
const ob = require('urbit-ob');
const crypto = require('crypto');
const STAR = '~binzod';
const STAR_HEX = ob.patp2hex(STAR);
for (var i = 0; i < 16; ++i) {
const byt = crypto.randomBytes(2).toString('hex');
console.log('0x' + byt + '.' + STAR_HEX, ob.hex2patp(byt + STAR_HEX));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment