Logo

Programming-Idioms

History of Idiom 175 > diff from v4 to v5

Edit summary for version 5 by programming-idioms.org:
[Pascal] No begin/end needed

Version 4

2018-12-28, 22:08:27

Version 5

2018-12-30, 12:36:19

Idiom #175 Bytes to hex string

From array a of n bytes, build the equivalent hex string s of 2n digits.
Each byte (256 possible values) is encoded as two hexadecimal characters (16 possible values per digit).

Idiom #175 Bytes to hex string

From array a of n bytes, build the equivalent hex string s of 2n digits.
Each byte (256 possible values) is encoded as two hexadecimal characters (16 possible values per digit).

Extra Keywords
hexa
Extra Keywords
hexa
Imports
sysutils
Imports
sysutils
Code
begin
  s := '';
  for b in a do s := s + IntToHex(b,2);
end.
Code
s := '';
for b in a do s := s + IntToHex(b,2);