一直在尋找的 unique string id generator

由於傳統的數字 primary key 太容易辨識(例:用 integer 當作 primary key),所以我一直想要找一個好的 java generator 來產生如同 document based database 的 document id;google 了好久,都找不到滿意的。

由於傳統的數字 primary key 太容易辨識(例:用 integer 當作 primary key),所以我一直想要找一個好的 java generator 來產生如同 document based database 的 document id;google 了好久,都找不到滿意的。

直到今天看到這個:https://github.com/ai/nanoid,是 JS 的 library。

有人翻寫成 Java 的 library:https://github.com/aventrix/jnanoid

就開心的拿來用囉。

有人問我為什麼不用 Java 自己的 UUID 就好?其實不是沒有用過,但 UUID 不知為何有時在 HTTP protocol 裡面傳遞時(實務上 GET/POST 都有碰過),會產生一些問題(但機率又很低),所以在這次改寫的時候,我就不考慮再用 UUID 了。

markkwsu

markkwsu

Add comment

Highlight option

Turn on the "highlight" option for any widget, to get an alternative styling like this. You can change the colors for highlighted widgets in the theme options. See more examples below.

Instagram

Instagram has returned empty data. Please authorize your Instagram account in the plugin settings .

Categories count color

Advertisement

Small ads

Flickr

  • obscurité
  • Sergio
  • cellule
  • jasmin de mer
  • le baobab
  • plastique invasif
  • grenades
  • evasion
  • wilson

Social Widget

Collaboratively harness market-driven processes whereas resource-leveling internal or "organic" sources.

ThemeForest