Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Elixxir dApps SDK Swift
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile
iOS
Elixxir dApps SDK Swift
Commits
caa34e37
Commit
caa34e37
authored
2 years ago
by
Dariusz Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
Add numBytes parameter to PasswordGenerator
parent
79e8e4ac
No related branches found
No related tags found
1 merge request
!2
Bindings API wrapper
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Sources/ElixxirDAppsSDK/PasswordGenerator.swift
+6
-6
6 additions, 6 deletions
Sources/ElixxirDAppsSDK/PasswordGenerator.swift
with
6 additions
and
6 deletions
Sources/ElixxirDAppsSDK/PasswordGenerator.swift
+
6
−
6
View file @
caa34e37
import
Bindings
public
struct
PasswordGenerator
{
public
var
run
:
()
->
Data
public
var
run
:
(
Int
)
->
Data
public
func
callAsFunction
()
->
Data
{
run
()
public
func
callAsFunction
(
numBytes
:
Int
=
32
)
->
Data
{
run
(
numBytes
)
}
}
extension
PasswordGenerator
{
public
static
let
live
=
PasswordGenerator
{
guard
let
secret
=
BindingsGenerateSecret
(
32
)
else
{
public
static
let
live
=
PasswordGenerator
{
numBytes
in
guard
let
secret
=
BindingsGenerateSecret
(
numBytes
)
else
{
fatalError
(
"BindingsGenerateSecret returned `nil`"
)
}
return
secret
...
...
@@ -19,7 +19,7 @@ extension PasswordGenerator {
#if DEBUG
extension
PasswordGenerator
{
public
static
let
failing
=
PasswordGenerator
{
public
static
let
failing
=
PasswordGenerator
{
_
in
Data
()
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment