Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

16 bytes binary form of canonical uuid representation in php

Tags:

php

uuid

how can I get 16 bytes binary form of the uuid from its string/canonical representation:

ex:1968ec4a-2a73-11df-9aca-00012e27a270

cheers, /Marcin

like image 417
Marcin Avatar asked Mar 20 '10 18:03

Marcin


1 Answers

 $bin = pack("h*", str_replace('-', '', $guid));

pack

like image 166
user187291 Avatar answered Sep 21 '22 22:09

user187291



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!