Skip to content

Instantly share code, notes, and snippets.

View pinhopro's full-sized avatar

Rodrigo Souza pinhopro

View GitHub Profile
@pinhopro
pinhopro / machine.js
Last active July 28, 2021 19:40
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@pinhopro
pinhopro / machine.js
Last active August 14, 2021 03:52
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@pinhopro
pinhopro / machine.js
Last active November 4, 2021 21:23
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@pinhopro
pinhopro / machine.js
Created November 16, 2021 18:46
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
import bisect
import hashlib
def check_mnemonic(word_list: list[str], mnemonic_list: list[str]) -> bool:
if len(mnemonic_list) not in [12, 15, 18, 21, 24]:
return False
try:
idx = map(lambda x:bin(word_list.index(x))[2:].zfill(11), mnemonic_list)
b = "".join(idx)