# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 1
# self = https://watcher.sour.is/conv/ktyaloa
【Go Web 開發】創建用戶激活 token
上一篇文章創建了 token 數據庫表,而我們激活過程的完整性取決於一件關鍵的事情:發送到用戶郵箱的 token(稱爲令牌)具有 “不可猜測性”。如果令牌很容易被猜到或可以被暴力破解,那麼攻擊者就有可能激活用戶帳戶,即使他們無法訪問用戶的郵箱。因此,需要生成的 token 具有足夠的隨機性,不可能被猜出來。在這裏我們使用 Go 的 crypto/rand 包 128 位(16 字節)墒。如果你跟隨 ⌘ Read more