Implementation
D

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
import "encoding/hex"
a, err := hex.DecodeString(s)
if err != nil {
	log.Fatal(err)
}
sysutils
for i := 0 to length(s) div 2 - 1 do
  a[i] := StrToInt('$'+Copy(s,2*(i)+1,2));
const base = 16
let a = s
  .replace(/../g, '$&_')
  .slice (0, -1)
  .split ('_')
  .map (
    (x) => parseInt (x, 16)
  )
a = bytearray.fromhex(s)
import std.algorithms;
import std.array;
import std.conv;
import std.range;
ubyte[] a = s.chunks(2)
             .map!(digits => digits.to!ubyte)
             .array;
use hex::FromHex
let a: Vec<u8> = Vec::from_hex(s).expect("Invalid Hex String");