Skip to content

Instantly share code, notes, and snippets.

@adamTrz
Last active November 12, 2019 14:23
Show Gist options
  • Select an option

  • Save adamTrz/ebc8e2742a7e6c4ff0320d2cc54760b0 to your computer and use it in GitHub Desktop.

Select an option

Save adamTrz/ebc8e2742a7e6c4ff0320d2cc54760b0 to your computer and use it in GitHub Desktop.
let aes256key: ?Array<number>;
sha256([brand, deviceId, ...otherIds].join('')).then(
(hash: string) => {
aes256key = Array.from(
Array.from(hash)
.map((c, i) => (i % 2 ? c : null))
.filter(Boolean)
.map(c => c.charCodeAt(0))
);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment