Fixed device token string->binary function