Skip to content

Instantly share code, notes, and snippets.

Avatar

Wes Roberts jchook

View GitHub Profile
@jchook
jchook / unicode.js
Last active Jun 20, 2019
JavaScript UTF-8 Helpers
View unicode.js
/**
* Convert a string to a unicode byte array
* @param {string} str
* @return {Array} of bytes
*/
export function strToUtf8Bytes(str) {
const utf8 = [];
for (let ii = 0; ii < str.length; ii++) {
let charCode = str.charCodeAt(ii);
if (charCode < 0x80) utf8.push(charCode);
View keybase.md

Keybase proof

I hereby claim:

  • I am jchook on github.
  • I am jchook (https://keybase.io/jchook) on keybase.
  • I have a public key ASDUWX3tq-lIZN6LFSGaQSXN1NBZFMHbn_j1EXvOlf8rwAo

To claim this, I am signing this object:

View gist:07aceb7c399ec1eb6686bc8335a621c7
### Keybase proof
I hereby claim:
* I am jchook on github.
* I am jchook (https://keybase.io/jchook) on keybase.
* I have a public key ASDUWX3tq-lIZN6LFSGaQSXN1NBZFMHbn_j1EXvOlf8rwAo
To claim this, I am signing this object:
You can’t perform that action at this time.