Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better gitignore #12

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## Special files
_*
.*
*~
*.lock

!.gitignore

## Compiled source
_obj/
_test/
target/

[568vq].out
*.[568vq]

*.[ao]
*.dll
*.so

*.cgo?.*
*.exe
*.prof
*.test

_testmain.go
go.sum

## Packages
# It's better to unpack these files and commit the raw source.
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

## Data
*.bin
Icon?

## Logs and databases
*.db
*.log
*.sqlite
#*.sql

## Projects

*.sublime-project
*.sublime-workspace

## * * *

7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

10 changes: 6 additions & 4 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
### Initial author
# Authors

[Jeramey Crawford](https://github.com/jeramey)
## Initial author

### Other authors
- Jeramey Crawford <jeramey@antihe.ro>

- [Jonas mg](https://github.com/kless)
## Other authors

- [Jonás Melián](https://github.com/kless)
- [Kohei YOSHIDA](https://github.com/yosida95)
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# crypt - A password hashing library for Go

crypt provides pure golang implementations of UNIX's crypt(3).

The goal of crypt is to bring a library of many common and popular password
hashing algorithms to Go and to provide a simple and consistent interface to
each of them. As every hashing method is implemented in pure Go, this library
should be as portable as Go itself.

All hashing methods come with a test suite which verifies their operation
against itself as well as the output of other password hashing implementations
to ensure compatibility with them.

I hope you find this library to be useful and easy to use!

**NOTE:** the package is a fork from 'github.com/GehirnInc/crypt'.

## Install

go get github.com/tredoe/crypt@latest


## Documentation

The documentation is available on
[go.dev](https://pkg.go.dev/github.com/tredoe/crypt)

## License

The source files are distributed under the *BSD 2-Clause "Simplified" License*
61 changes: 0 additions & 61 deletions README.rst

This file was deleted.

11 changes: 5 additions & 6 deletions apr1_crypt/apr1_crypt.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// (C) Copyright 2012, Jeramey Crawford <jeramey@antihe.ro>. All
// rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// SPDX-FileCopyrightText: 2012 Jeramey Crawford <jeramey@antihe.ro>
// SPDX-License-Identifier: BSD-2-Clause

// Package apr1_crypt implements the standard Unix MD5-crypt algorithm created
// by Poul-Henning Kamp for FreeBSD, and modified by the Apache project.
Expand All @@ -10,9 +9,9 @@
package apr1_crypt

import (
"github.com/GehirnInc/crypt"
"github.com/GehirnInc/crypt/common"
"github.com/GehirnInc/crypt/md5_crypt"
"github.com/tredoe/crypt"
"github.com/tredoe/crypt/common"
"github.com/tredoe/crypt/md5_crypt"
)

func init() {
Expand Down
5 changes: 2 additions & 3 deletions apr1_crypt/apr1_crypt_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// (C) Copyright 2012, Jeramey Crawford <jeramey@antihe.ro>. All
// rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// SPDX-FileCopyrightText: 2012 Jeramey Crawford <jeramey@antihe.ro>
// SPDX-License-Identifier: BSD-2-Clause

package apr1_crypt

Expand Down
13 changes: 6 additions & 7 deletions common/base64.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// (C) Copyright 2012, Jeramey Crawford <jeramey@antihe.ro>. All
// rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// SPDX-FileCopyrightText: 2012 Jeramey Crawford <jeramey@antihe.ro>
// SPDX-License-Identifier: BSD-2-Clause

package common

Expand All @@ -14,10 +13,10 @@ const (
// The algorithm operates on up to 3 bytes at a time, encoding the following
// 6-bit sequences into up to 4 hash64 ASCII bytes.
//
// 1. Bottom 6 bits of the first byte
// 2. Top 2 bits of the first byte, and bottom 4 bits of the second byte.
// 3. Top 4 bits of the second byte, and bottom 2 bits of the third byte.
// 4. Top 6 bits of the third byte.
// 1. Bottom 6 bits of the first byte
// 2. Top 2 bits of the first byte, and bottom 4 bits of the second byte.
// 3. Top 4 bits of the second byte, and bottom 2 bits of the third byte.
// 4. Top 6 bits of the third byte.
//
// This encoding method does not emit padding bytes as Base64 does.
func Base64_24Bit(src []byte) []byte {
Expand Down
5 changes: 2 additions & 3 deletions common/doc.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// (C) Copyright 2012, Jeramey Crawford <jeramey@antihe.ro>. All
// rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// SPDX-FileCopyrightText: 2012 Jeramey Crawford <jeramey@antihe.ro>
// SPDX-License-Identifier: BSD-2-Clause

// Package common contains routines used by multiple password hashing
// algorithms.
Expand Down
19 changes: 9 additions & 10 deletions common/salt.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// (C) Copyright 2012, Jeramey Crawford <jeramey@antihe.ro>. All
// rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// SPDX-FileCopyrightText: 2012 Jeramey Crawford <jeramey@antihe.ro>
// SPDX-License-Identifier: BSD-2-Clause

package common

Expand Down Expand Up @@ -37,8 +36,8 @@ type Salt struct {
//
// The length is set thus:
//
// length > SaltLenMax: length = SaltLenMax
// length < SaltLenMin: length = SaltLenMin
// length > SaltLenMax: length = SaltLenMax
// length < SaltLenMin: length = SaltLenMin
func (s *Salt) Generate(length int) []byte {
if length > s.SaltLenMax {
length = s.SaltLenMax
Expand All @@ -64,12 +63,12 @@ func (s *Salt) Generate(length int) []byte {
//
// The parameters are set thus:
//
// length > SaltLenMax: length = SaltLenMax
// length < SaltLenMin: length = SaltLenMin
// length > SaltLenMax: length = SaltLenMax
// length < SaltLenMin: length = SaltLenMin
//
// rounds < 0: rounds = RoundsDefault
// rounds < RoundsMin: rounds = RoundsMin
// rounds > RoundsMax: rounds = RoundsMax
// rounds < 0: rounds = RoundsDefault
// rounds < RoundsMin: rounds = RoundsMin
// rounds > RoundsMax: rounds = RoundsMax
//
// If rounds is equal to RoundsDefault, then the "rounds=" part of the salt is
// removed.
Expand Down
17 changes: 8 additions & 9 deletions common/salt_test.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
// (C) Copyright 2012, Jeramey Crawford <jeramey@antihe.ro>. All
// rights reserved. Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// SPDX-FileCopyrightText: 2012 Jeramey Crawford <jeramey@antihe.ro>
// SPDX-License-Identifier: BSD-2-Clause

package common

import (
"testing"
"fmt"
"strings"
"testing"
)

var _Salt = &Salt{
MagicPrefix: []byte("$foo$"),
SaltLenMin: 1,
SaltLenMax: 8,
MagicPrefix: []byte("$foo$"),
SaltLenMin: 1,
SaltLenMax: 8,
RoundsDefault: 5,
RoundsMin: 1,
RoundsMax: 10,
RoundsMin: 1,
RoundsMax: 10,
}

func TestGenerateSalt(t *testing.T) {
Expand Down