chore: sort imports in the Markdown examples (#3822)

This commit is contained in:
John Bampton 2021-03-24 11:05:14 +10:00 committed by GitHub
parent b17feb59bb
commit a2b69b1530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -24,9 +24,9 @@ title: HMAC Generate Signature Examples
## Python 3 ## Python 3
```python ```python
import base64
import hashlib import hashlib
import hmac import hmac
import base64
secret = bytes('the shared secret key here', 'utf-8') secret = bytes('the shared secret key here', 'utf-8')
message = bytes('this is signature string', 'utf-8') message = bytes('this is signature string', 'utf-8')
@ -46,8 +46,8 @@ base64.b64encode(hash.digest())
```java ```java
import javax.crypto.Mac; import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec; import javax.crypto.spec.SecretKeySpec;
import java.security.NoSuchAlgorithmException;
import java.security.InvalidKeyException; import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.xml.bind.DatatypeConverter; import javax.xml.bind.DatatypeConverter;
class Main { class Main {
@ -103,8 +103,8 @@ func main() {
## Ruby ## Ruby
```ruby ```ruby
require 'openssl'
require 'base64' require 'base64'
require 'openssl'
secret = 'the shared secret key here' secret = 'the shared secret key here'
message = 'this is signature string' message = 'this is signature string'

View File

@ -168,9 +168,9 @@ Note: The last request header also needs + `\n`.
Use Python to generate the signature `SIGNATURE`: Use Python to generate the signature `SIGNATURE`:
```python ```python
import base64
import hashlib import hashlib
import hmac import hmac
import base64
secret = bytes('my-secret-key', 'utf-8') secret = bytes('my-secret-key', 'utf-8')
message = bytes("""GET message = bytes("""GET

View File

@ -162,9 +162,9 @@ x-custom-a:test
使用 Python 来生成签名 `SIGNATURE` 使用 Python 来生成签名 `SIGNATURE`
```python ```python
import base64
import hashlib import hashlib
import hmac import hmac
import base64
secret = bytes('my-secret-key', 'utf-8') secret = bytes('my-secret-key', 'utf-8')
message = bytes("""GET message = bytes("""GET