func thumbprintStringToHex()

in pkg/decrypt/decypt_windows.go [93:112]


func thumbprintStringToHex(s string) ([]byte, error) {
	// Remove the UTF mark if we have one
	runes := []rune(s)
	if len(runes)%2 == 1 {
		runes = []rune(s)[1:]
	}

	length := len(runes) / 2
	parts := make([]byte, length)
	for count := 0; count < length; count++ {
		r := runes[count*2 : count*2+2]
		sp := string(r)
		bp, err := strconv.ParseUint(sp, 16, 16)
		if err == nil {
			parts[count] = byte(bp)
		}
	}

	return parts, nil
}