Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Convert CryptoRandom and OSRandom into structs to save allocations #65

Merged
merged 2 commits into from
May 30, 2018
Merged
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
2 changes: 1 addition & 1 deletion Sources/Crypto/Random/CryptoRandom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
import Random

/// Uses OpenSSL `RAND_bytes` to generate random data.
public final class CryptoRandom: DataGenerator {
public struct CryptoRandom: DataGenerator {
/// Creates a new `CryptoRandom`.
public init() {}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Random/OSRandom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
import COperatingSystem

/// Uses the operating system's Random function uses `random` on Linux and `arc4random` on macOS.
public final class OSRandom: DataGenerator {
public struct OSRandom: DataGenerator {
/// Create a new `OSRandom`
public init() {}

Expand Down