---
title: "data(forTag:)"
framework: cryptotokenkit
role: symbol
role_heading: Type Method
path: "cryptotokenkit/tkbertlvrecord/data(fortag:)"
---

# data(forTag:)

Encodes a specified tag using BER-TLV tag encoding rules.

## Declaration

```swift
class func data(forTag tag: TKTLVTag) -> Data
```

## Parameters

- `tag`: The tag value to encode.

## Return Value

Return Value A data object that encodes a tag value using BER-TLV encoding.
