Move mint utility to syndicate_utils
This commit is contained in:
parent
dcd6bfe99b
commit
d86ef24c01
|
@ -49,21 +49,4 @@ proc validate*[T](key: openarray[byte]; sturdy: SturdyRef[T]): bool =
|
|||
sig = hmac(sig, encode cav)
|
||||
result = (sig == ctrl.get.bytes)
|
||||
|
||||
when isMainModule:
|
||||
from os import commandLineParams
|
||||
|
||||
var key: array[16, byte]
|
||||
case readBytes(stdin, key, 0, 16)
|
||||
of 16: discard
|
||||
of 0: stderr.writeLine "using null key"
|
||||
else: quit "expected sixteen bytes of key from stdin"
|
||||
|
||||
var oids: seq[Preserve[void]]
|
||||
for p in commandLineParams():
|
||||
add(oids, parsePreserves p)
|
||||
if oids.len == 0: oids.add(toPreserve "syndicate")
|
||||
|
||||
for oid in oids:
|
||||
let sturdy = mint(key, oid)
|
||||
doAssert validate(key, sturdy)
|
||||
stdout.writeLine(sturdy)
|
||||
# mint utility moved to syndicate_utils/src/mintsturdyref.nim
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Package
|
||||
|
||||
version = "20230822"
|
||||
version = "20230825"
|
||||
author = "Emery Hemingway"
|
||||
description = "Syndicated actors for conversational concurrency"
|
||||
license = "Unlicense"
|
||||
|
|
Loading…
Reference in New Issue