: HEX,{ ( "hex-byte hex-byte ... }" ) \ Add bytes in hex to dictionary
\ Temporary hex numbers
BASE @
HEX
\ Loop over input
BEGIN
0.
\ Read while parse area has content and not }
PARSE-NAME
DUP IF
2DUP S" }" COMPARE
ELSE
FALSE
THEN
WHILE
\ Convert to number and add to dictionary
( 0 name-a name-u ) >NUMBER 2DROP D>S C,
REPEAT
2DROP 2DROP
\ Restore BASE
BASE ! ;
CREATE TEST
HEX,{ 10 20 30 40 50 10 20 30 10 20 }
HERE TEST - CONSTANT #TEST
: .TEST #TEST 0 ?DO TEST I + C@ . LOOP CR ;
.TEST
OiBIRVgseyAoICJoZXgtYnl0ZSBoZXgtYnl0ZSAuLi4gfSIgKSBcIEFkZCBieXRlcyBpbiBoZXggdG8gZGljdGlvbmFyeQoJXCBUZW1wb3JhcnkgaGV4IG51bWJlcnMKCUJBU0UgQAoJSEVYCgoJXCBMb29wIG92ZXIgaW5wdXQKCUJFR0lOCgkJMC4KCgkJXCBSZWFkIHdoaWxlIHBhcnNlIGFyZWEgaGFzIGNvbnRlbnQgYW5kIG5vdCB9CgkJUEFSU0UtTkFNRQoJCURVUCBJRgoJCQkyRFVQIFMiIH0iIENPTVBBUkUKCQlFTFNFCgkJCUZBTFNFCgkJVEhFTgoJCVdISUxFCgoJCVwgQ29udmVydCB0byBudW1iZXIgYW5kIGFkZCB0byBkaWN0aW9uYXJ5CgkJKCAwIG5hbWUtYSBuYW1lLXUgKSA+TlVNQkVSIDJEUk9QIEQ+UyBDLAoJUkVQRUFUCgoJMkRST1AgMkRST1AKCglcIFJlc3RvcmUgQkFTRQoJQkFTRSAhIDsKCgpDUkVBVEUgVEVTVAoJSEVYLHsgMTAgMjAgMzAgNDAgNTAgMTAgMjAgMzAgMTAgMjAgfQoKSEVSRSBURVNUIC0gQ09OU1RBTlQgI1RFU1QKCjogLlRFU1QgI1RFU1QgMCA/RE8gVEVTVCBJICsgQ0AgLiBMT09QIENSIDsKCi5URVNUCg==