???????????????梅????????????????????????????????????????????????????????????????????????????????????伪??????????婊�?懈?????????????????????????
????2??????????????($RANDOM)
?????????linux??????懈?????????????????????????????????????????????????????????
????[chengmo@centos5 shell]$ echo $RANDOM
????10918
????[chengmo@centos5 shell]$ echo $RANDOM
????10001
????#????2?畏??????????????????????????小??????5位??????
????????????????????????5位????????????????
??????????????10位????????????????????1 ???????????????????????????????????????
????3?????????????????????????/dev/random??urandom)
???????????dev?????妫�??linux?些????璞�??????????芯??????????????????????璞�?????????? ???linux??些?璞�??????????????????????????????/dev/[udp|tcp]/host/port???????伞??????谐?????
????/dev/random?璞�???娲�??????????械?????????????????????????????????????????????????????????????????????????????????????????????/dev/urandom????璞�??????random?????????????????????????????????????????????????????????
?????????
????[chengmo@centos5 shell]$ head -1 /dev/urandom
???????ù…?KTt?anV??1?&???“?2íùU“ ?F|_ ?”?mEe?Urá?=J??T?A?ìAúRtó
????#????校??????????????????????????????????????????????????????????????????????????
????[chengmo@centos5 ~/shell]$ head -200 /dev/urandom | cksum
????1615228479 50333
????#????urandom??????????????????????cat???????????200?校???????????????浠�????????????????
????#cksum ????????????????????????????????????????????????????浠�????php crc????
????[chengmo@centos5 shell]$ head -200 /dev/urandom | cksum | cut -f1 -d" "
????484750180
????#cut ??” “???????????????????????
???????????????????????????????????????????? ??????????????妫�???????md5???????????????????????????????????????????crc????.crc?????????校?椋�?????????????????????????????????????????????煤?????????????慰???crc.
???????婊�?懈????????????璞�?????????uuid??
????4?????linux ??uuid??
????????????????懈???????????uuid???
????UUID??????????????? (Universally Unique Identifier?? UUID)???? ????????????????????????????????? (Open Software Foundation?? OSF) ???????????????? (Distributed Computing Environment?? DCE) ???????????
????UUID ?????????梅??????械??????????????械?????????????????????????????????????????????????????????????????????????????? UUID??????????????锟�????杩�??????????????????????????????????魏???????????????uuid??????????????????????????械?????????????????????????????????????????
????UUID??????????32??16??位???????“-”?????????危?????8-4-4-4-12??32?????????????550e8400-e29b-41d4-a716-446655440000 ???????UUID????????????216 x 8=2128???????3.4 x 1038?? ??????????????1???UUID?????100??????????UUID????
???????????????????????????????????guid(???????)???????????uuid?????????????? ????????????胁?????????????????e????windows???妫�?????????????????????????????????uuid????
????linux ??uuid??
????linux??uuid?????????????????/proc/sys/kernel/random/uuid??????????????random???????婊�?泻???????????????????uuid?泄?????
????[chengmo@centos5 ~/shell]$ cat /proc/sys/kernel/random/uuid
????dff68213-b700-4947-87b1-d9e640334196
????[chengmo@centos5 ~/shell]$ cat /proc/sys/kernel/random/uuid
????7b57209a-d285-4fd0-88b4-9d3162d2e1bc
????#????2?味?????????uuid??????
????[chengmo@centos5 ~/shell]$ cat /proc/sys/kernel/random/uuid| cksum | cut -f1 -d" "
????2141807556
????#????????????????
????????linux???妫�???????????????????????????????????????????3??????????????伪?????????????/dev/random?璞�?泄??????????????????????????????懈?????????????????????????????????