Customizações Avançadas
Bibliotecas
HMAC
utilizado para gerar tokens hmac com os algoritmos de criptografia sha 256, sha 512 ou sha 1 atalhos métodos new sha 256 \ @param secret the secret used to create the hmac \ @param input the input used to create the hmac \ @return bytes that can be transformed into base64 on hex string to be used hmac\["sha256"] new(secret, input) \ example usage local my hmac = hmac\["sha256"] new("secret", "input") local hmac base64 = base64 encode(my hmac) \ jymf0et6vtllqjd5o9qggedsaaiq7bwvjnkw9wlmamy= local hmac hex = x\ gsub(" ", function(s) return string format("%02x", string byte(s)) end) \ 8d8985d04b7abd32cbaa3779a3daa019e0d269a22aec15af8e7296f702cc68c6 new sha 512 \ @param secret the secret used to create the hmac \ @param input the input used to create the hmac \ @return bytes that can be transformed into base64 on hex string to be used hmac\["sha512"] new(secret, input) \ example usage local my hmac = hmac\["sha512"] new("secret", "input") local hmac base64 = base64 encode(my hmac) \ ksle03f+bcxwzkx6fdgcmm022f4g+p+dc9bmox42fingn0a38vh/oco/smwxksfebkxcwi8p8d6fdlbada74hw== local hmac hex = x\ gsub(" ", function(s) return string format("%02x", string byte(s)) end) \ 2ac95ed3717e042c7064a5fa7c318230cd36d85e06f8ff8373d04ca17e361629e09f46b7f151ff382a3f48c5b19121446e45c2588f0ff1de9f74b0400daef81f new sha 1 \ @param secret the secret used to create the hmac \ @param input the input used to create the hmac \ @return bytes that can be transformed into base64 on hex string to be used hmac\["sha1"] new(secret, input) \ example usage local my sha1 hmac = hmac\["sha1"] new("secret", "input")