help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Constructing and Manipulating Raw Strings


From: Pascal J. Bourguignon
Subject: Re: Constructing and Manipulating Raw Strings
Date: Wed, 08 Dec 2010 15:31:44 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Nordlöw <per.nordlow@gmail.com> writes:

> What is the best way to extract the individual bytes from hexadecimal
> string (output from md5) and using them as input into a call to
> unibyte-string()?
>
> I want to use this raw string as a key in a hash table for file types
> and then I don't want to waste space (size halves if we go from a
> hexadecimal string to a raw byte string).
>
> Does read() (or some of its variants) support reading raw unibyte
> strings (that may contain zero bytes).

You can use decode-hex-string instead:

(decode-hex-string "4142434445464748494a4b4c4d4e4f")
--> "ABCDEFGHIJKLMNO"

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]