mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-06-11 04:15:12 +02:00
Added php
parent
4716cbf5d2
commit
0b96a00978
1 changed files with 10 additions and 1 deletions
|
|
@ -100,4 +100,13 @@ import URLSafeBase64 from 'urlsafe-base64';
|
|||
let key = 'secret key';
|
||||
let data = 'https://octodex.github.com/images/codercat.jpg';
|
||||
console.log(URLSafeBase64.encode(crypto.createHmac('sha256', key).update(data).digest()));
|
||||
```
|
||||
```
|
||||
|
||||
### PHP
|
||||
|
||||
````php
|
||||
<?php
|
||||
$key = 'test';
|
||||
$data = "https://www.google.fr/images/srpr/logo11w.png";
|
||||
echo strtr(base64_encode(hash_hmac('sha256', $data, $key, 1)), '/+' , '_-');
|
||||
````
|
||||
Loading…
Add table
Add a link
Reference in a new issue