<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/SymmetricKeySize/init(bitCount:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit16SymmetricKeySizeV8bitCountACSi_tcfc"
  },
  "title" : "init(bitCount:)"
}
-->

# init(bitCount:)

Creates a new key size of the given length.

```
init(bitCount: Int)
```

## Parameters

`bitCount`

The number of bits in the key size.

## Discussion

In most cases, you can use one of the standard key sizes, like bits256.
If instead you need a key with a non-standard size, use the
[`init(bitCount:)`](/documentation/CryptoKit/SymmetricKeySize/init(bitCount:)) initializer to create a custom key size.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)