Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
455 changes: 307 additions & 148 deletions docs/user/ppl/functions/aggregations.md

Large diffs are not rendered by default.

473 changes: 324 additions & 149 deletions docs/user/ppl/functions/collection.md

Large diffs are not rendered by default.

537 changes: 303 additions & 234 deletions docs/user/ppl/functions/condition.md

Large diffs are not rendered by default.

185 changes: 104 additions & 81 deletions docs/user/ppl/functions/conversion.md

Large diffs are not rendered by default.

64 changes: 37 additions & 27 deletions docs/user/ppl/functions/cryptographic.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
# PPL Cryptographic Functions
# Cryptographic functions

## MD5
The following cryptographic functions are supported in PPL.

### Description
## MD5

Version: 3.1.0
Usage: `md5(str)` calculates the MD5 digest and returns the value as a 32-character hex string.
**Usage**: `MD5(str)`

**Argument type:** `STRING`
**Return type:** `STRING`
Calculates the MD5 digest and returns the value as a 32-character hex string.

### Example
**Parameters**:

- `str` (Required): The string for which to calculate the MD5 digest.

**Return type**: `STRING`

#### Example

```ppl
source=people
| eval `MD5('hello')` = MD5('hello')
| fields `MD5('hello')`
```

Expected output:
The query returns the following results:

```text
fetched rows / total rows = 1/1
Expand All @@ -29,25 +33,27 @@ fetched rows / total rows = 1/1
+----------------------------------+
```

## SHA1
## SHA1

**Usage**: `SHA1(str)`

### Description
Returns the SHA-1 hash as a hex string.

Version: 3.1.0
Usage: `sha1(str)` returns the hex string result of SHA-1.
**Parameters**:

**Argument type:** `STRING`
**Return type:** `STRING`
- `str` (Required): The string for which to calculate the SHA-1 hash.

### Example
**Return type**: `STRING`

#### Example

```ppl
source=people
| eval `SHA1('hello')` = SHA1('hello')
| fields `SHA1('hello')`
```

Expected output:
The query returns the following results:

```text
fetched rows / total rows = 1/1
Expand All @@ -58,26 +64,28 @@ fetched rows / total rows = 1/1
+------------------------------------------+
```

## SHA2
## SHA2

**Usage**: `SHA2(str, numBits)`

### Description
Returns the result of SHA-2 family hash functions (SHA-224, SHA-256, SHA-384, and SHA-512) as a hex string.

Version: 3.1.0
Usage: `sha2(str, numBits)` returns the hex string result of SHA-2 family of hash functions (SHA-224, SHA-256, SHA-384, and SHA-512).
The numBits indicates the desired bit length of the result, which must have a value of 224, 256, 384, or 512.
**Parameters**:

**Argument type:** `STRING`, `INTEGER`
**Return type:** `STRING`
- `str` (Required): The string for which to calculate the SHA-2 hash.
- `numBits` (Required): The desired bit length of the result, which must be `224`, `256`, `384`, or `512`.

### Example
**Return type**: `STRING`

#### Example: SHA-256 hash

```ppl
source=people
| eval `SHA2('hello',256)` = SHA2('hello',256)
| fields `SHA2('hello',256)`
```

Expected output:
The query returns the following results:

```text
fetched rows / total rows = 1/1
Expand All @@ -87,14 +95,16 @@ fetched rows / total rows = 1/1
| 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 |
+------------------------------------------------------------------+
```

#### Example: SHA-512 hash

```ppl
source=people
| eval `SHA2('hello',512)` = SHA2('hello',512)
| fields `SHA2('hello',512)`
```

Expected output:
The query returns the following results:

```text
fetched rows / total rows = 1/1
Expand Down
Loading
Loading