Skip to content

Instantly share code, notes, and snippets.

@toomasv
Created November 15, 2019 13:52
Show Gist options
  • Select an option

  • Save toomasv/2711cc14ce05c53c128a21aecf0931e0 to your computer and use it in GitHub Desktop.

Select an option

Save toomasv/2711cc14ce05c53c128a21aecf0931e0 to your computer and use it in GitHub Desktop.
Dehexing to char
Red [
Purpose: {Workaround for limitation of official `dehex` func}
Date: 2019-11-15
Author: "Toomas Vooglaid"
Licence: "Public domain"
]
de-hex: func [hex [string!] /low][
if odd? length? hex [
hex: copy next hex
]
if any [low 2 = len: length? hex] [
hex: pad/with/left hex 8 #"0"
]
hex: debase/base hex 16
to-char either any [low len = 2] [to-integer hex][hex]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment