All pastes #238464 Raw Edit

Someone

public text v1 · immutable
·published 2006-11-05 00:09 UTC
rendered paste body
toHex(tal) = toHex'(tal,"");

fun toHex'(0,hex)=hex
| toHex'(tal,hex)=
let val a = tal div 16
    val b = tal mod 16
    fun c = (case b of
	0 => "0"
|	1 => "1"
|	2 => "2"
|	3 => "3"
|	4 => "4"
|	5 => "5"
|	6 => "6"
|	7 => "7"
|	8 => "8"
|	9 => "9"
|	10 => "A"
|	11 => "B"
|	12 => "C"
|	13 => "D"
|	14 => "E"
|	15 => "F")

in  toHex'(a,c ^ hex);