<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/UInt8/FixedWidthInteger-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "FixedWidthInteger Implementations"
}
-->

# FixedWidthInteger Implementations

## Topics

### Operators

[`static func &* (Self, Self) -> Self`](/documentation/Swift/UInt8/&*(_:_:))

Returns the product of the two given values, wrapping the result in case
of any overflow.

[`static func &*= (inout Self, Self)`](/documentation/Swift/UInt8/&*=(_:_:))

Multiplies two values and stores the result in the left-hand-side
variable, wrapping any overflow.

[`static func &+ (Self, Self) -> Self`](/documentation/Swift/UInt8/&+(_:_:))

Returns the sum of the two given values, wrapping the result in case of
any overflow.

[`static func &+= (inout Self, Self)`](/documentation/Swift/UInt8/&+=(_:_:))

Adds two values and stores the result in the left-hand-side variable,
wrapping any overflow.

[`static func &- (Self, Self) -> Self`](/documentation/Swift/UInt8/&-(_:_:))

Returns the difference of the two given values, wrapping the result in
case of any overflow.

[`static func &-= (inout Self, Self)`](/documentation/Swift/UInt8/&-=(_:_:))

Subtracts the second value from the first and stores the difference in the
left-hand-side variable, wrapping any overflow.

[`static func &>> (UInt8, UInt8) -> UInt8`](/documentation/Swift/UInt8/&__(_:_:)-1fquv)

Returns the result of shifting a value’s binary representation the
specified number of digits to the right, masking the shift amount to the
type’s bit width.

[`static func &>> <Other>(Self, Other) -> Self`](/documentation/Swift/UInt8/&__(_:_:)-3qwyl)

Returns the result of shifting a value’s binary representation the
specified number of digits to the right, masking the shift amount to the
type’s bit width.

[`static func &<< (Self, Self) -> Self`](/documentation/Swift/UInt8/&__(_:_:)-5m6yb)

Returns the result of shifting a value’s binary representation the
specified number of digits to the left, masking the shift amount to the
type’s bit width.

[`static func &<< <Other>(Self, Other) -> Self`](/documentation/Swift/UInt8/&__(_:_:)-60i6u)

Returns the result of shifting a value’s binary representation the
specified number of digits to the left, masking the shift amount to the
type’s bit width.

[`static func &>> (Self, Self) -> Self`](/documentation/Swift/UInt8/&__(_:_:)-6jqbr)

Returns the result of shifting a value’s binary representation the
specified number of digits to the right, masking the shift amount to the
type’s bit width.

[`static func &<< (UInt8, UInt8) -> UInt8`](/documentation/Swift/UInt8/&__(_:_:)-7gp0b)

Returns the result of shifting a value’s binary representation the
specified number of digits to the left, masking the shift amount to the
type’s bit width.

[`static func &>>= <Other>(inout Self, Other)`](/documentation/Swift/UInt8/&__=(_:_:)-16yhm)

Calculates the result of shifting a value’s binary representation the
specified number of digits to the right, masking the shift amount to the
type’s bit width, and stores the result in the left-hand-side variable.

[`static func &<<= <Other>(inout Self, Other)`](/documentation/Swift/UInt8/&__=(_:_:)-60dw2)

Returns the result of shifting a value’s binary representation the
specified number of digits to the left, masking the shift amount to the
type’s bit width, and stores the result in the left-hand-side variable.

### Initializers

[`init?(String)`](/documentation/Swift/UInt8/init(_:)-1iroc)

Creates a new integer value from the given string.

[`init<T>(T)`](/documentation/Swift/UInt8/init(_:)-5e02)

[`init?<S>(S, radix: Int)`](/documentation/Swift/UInt8/init(_:radix:))

Creates a new integer value from the given string and radix.

[`init(bigEndian: Self)`](/documentation/Swift/UInt8/init(bigEndian:))

Creates an integer from its big-endian representation, changing the byte
order if necessary.

[`init?<T>(exactly: T)`](/documentation/Swift/UInt8/init(exactly:)-8szg6)

[`init(littleEndian: Self)`](/documentation/Swift/UInt8/init(littleEndian:))

Creates an integer from its little-endian representation, changing the
byte order if necessary.

### Instance Properties

[`var bigEndian: Self`](/documentation/Swift/UInt8/bigEndian)

The big-endian representation of this integer.

[`var littleEndian: Self`](/documentation/Swift/UInt8/littleEndian)

The little-endian representation of this integer.

### Type Methods

[`static func random(in: Range<Self>) -> Self`](/documentation/Swift/UInt8/random(in:)-6wnz5)

Returns a random value within the specified range.

[`static func random(in: ClosedRange<Self>) -> Self`](/documentation/Swift/UInt8/random(in:)-85h4o)

Returns a random value within the specified range.

[`static func random<T>(in: Range<Self>, using: inout T) -> Self`](/documentation/Swift/UInt8/random(in:using:)-3zjsj)

Returns a random value within the specified range, using the given
generator as a source for randomness.

[`static func random<T>(in: ClosedRange<Self>, using: inout T) -> Self`](/documentation/Swift/UInt8/random(in:using:)-6l2z5)

Returns a random value within the specified range, using the given
generator as a source for randomness.

---

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)