nim-tnetstring/tests/tnetobjects/t_can_be_hashed.nim
mahlon 9aa2912286 10 years later... updates for modern Nim.
FossilOrigin-Name: 7361ae25595c1916e9701a25033b684e3cd089d8abb71ead3803a59e36189f63
2025-04-03 18:27:46 +00:00

13 lines
250 B
Nim

# vim: set et sta sw=4 ts=4 :
import
std/hashes
import tnetstring
# Hashes to the underlying object type.
let tnet_int = parse_tnetstring( "1:1#" )
assert tnet_int.hash == 1.hash
assert parse_tnetstring( "4:true!" ).hash == hash( true.int )