# Namespace: utils

## CaskSDK.utils

General helpers and utilities

### Methods

#### (static) encodePlanData(planId, price, period, freeTrial, maxActive, minPeriods, gracePeriod, canPause, canTransfer) → {string}

Encode a subscription plan into the raw format expected by the contracts.

##### Parameters:

Name | Type | Description
--- | --- | ---
`planId` |  |
`price` |  |
`period` |  |
`freeTrial` |  |
`maxActive` |  |
`minPeriods` |  |
`gracePeriod` |  |
`canPause` |  |
`canTransfer` |  |

##### Returns:

bytes32 encoded data

Type
  string

#### (static) parsePlanData(planData) → {Plan}

Parses a packed plan data bytes32 value into a plan Object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`planData` |  |

##### Returns:

The decoded plan

Type
  Plan