mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-02 12:07:35 +08:00
chore: sort imports in the Markdown examples (#3822)
This commit is contained in:
parent
b17feb59bb
commit
a2b69b1530
@ -24,9 +24,9 @@ title: HMAC Generate Signature Examples
|
||||
## Python 3
|
||||
|
||||
```python
|
||||
import base64
|
||||
import hashlib
|
||||
import hmac
|
||||
import base64
|
||||
|
||||
secret = bytes('the shared secret key here', 'utf-8')
|
||||
message = bytes('this is signature string', 'utf-8')
|
||||
@ -46,8 +46,8 @@ base64.b64encode(hash.digest())
|
||||
```java
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
class Main {
|
||||
@ -103,8 +103,8 @@ func main() {
|
||||
## Ruby
|
||||
|
||||
```ruby
|
||||
require 'openssl'
|
||||
require 'base64'
|
||||
require 'openssl'
|
||||
|
||||
secret = 'the shared secret key here'
|
||||
message = 'this is signature string'
|
||||
|
@ -168,9 +168,9 @@ Note: The last request header also needs + `\n`.
|
||||
Use Python to generate the signature `SIGNATURE`:
|
||||
|
||||
```python
|
||||
import base64
|
||||
import hashlib
|
||||
import hmac
|
||||
import base64
|
||||
|
||||
secret = bytes('my-secret-key', 'utf-8')
|
||||
message = bytes("""GET
|
||||
|
@ -162,9 +162,9 @@ x-custom-a:test
|
||||
使用 Python 来生成签名 `SIGNATURE`:
|
||||
|
||||
```python
|
||||
import base64
|
||||
import hashlib
|
||||
import hmac
|
||||
import base64
|
||||
|
||||
secret = bytes('my-secret-key', 'utf-8')
|
||||
message = bytes("""GET
|
||||
|
Loading…
Reference in New Issue
Block a user