<commit_before>package main

import (
	"encoding/json"
	"flag"
	"fmt"
	"os"

	"github.com/stuphlabs/pullcord/authentication"
)

const maxUint16 = ^uint16(0)

func main() {
	var rawIterations uint
	flag.UintVar(
		&rawIterations,
		"iterations",
		uint(authentication.Pbkdf2MinIterations),
		"Iteration count for PBKDF2",
	)

	var password string
	flag.StringVar(
		&password,
		"password",
		"",
		"Password string, taken from stdin if empty or not specified",
	)

	flag.Parse()

	if rawIterations < uint(authentication.Pbkdf2MinIterations) {
		panic(fmt.Errorf(
			"Iteration count must be at least %d",
			authentication.Pbkdf2MinIterations,
		))
	} else if rawIterations > uint(maxUint16) {
		panic(fmt.Errorf(
			"Iteration count must be no greater than %d",
			maxUint16,
		))
	}
	var iterations uint16 = uint16(rawIterations)

	if password == "" {
		fmt.Fprintf(os.Stderr, "Password: ")

		_, err := fmt.Scanf("%s\n", &password)
		if err != nil {
			panic(err)
		}
	}

	hash, err := authentication.GetPbkdf2Hash(password, iterations)
	if err != nil {
		panic(err)
	}

	enc := json.NewEncoder(os.Stdout)
	err = enc.Encode(hash)
	if err != nil {
		panic(err)
	}
}<commit_msg>Removing redundant type declaration<commit_after>package main

import (
	"encoding/json"
	"flag"
	"fmt"
	"os"

	"github.com/stuphlabs/pullcord/authentication"
)

const maxUint16 = ^uint16(0)

func main() {
	var rawIterations uint
	flag.UintVar(
		&rawIterations,
		"iterations",
		uint(authentication.Pbkdf2MinIterations),
		"Iteration count for PBKDF2",
	)

	var password string
	flag.StringVar(
		&password,
		"password",
		"",
		"Password string, taken from stdin if empty or not specified",
	)

	flag.Parse()

	if rawIterations < uint(authentication.Pbkdf2MinIterations) {
		panic(fmt.Errorf(
			"Iteration count must be at least %d",
			authentication.Pbkdf2MinIterations,
		))
	} else if rawIterations > uint(maxUint16) {
		panic(fmt.Errorf(
			"Iteration count must be no greater than %d",
			maxUint16,
		))
	}
	iterations := uint16(rawIterations)

	if password == "" {
		fmt.Fprintf(os.Stderr, "Password: ")

		_, err := fmt.Scanf("%s\n", &password)
		if err != nil {
			panic(err)
		}
	}

	hash, err := authentication.GetPbkdf2Hash(password, iterations)
	if err != nil {
		panic(err)
	}

	enc := json.NewEncoder(os.Stdout)
	err = enc.Encode(hash)
	if err != nil {
		panic(err)
	}
}
{'fraction_non_alphanumeric': 0.13291139240506328, 'fraction_numerical': 0.014345991561181435, 'mean_word_length': 3.8987603305785123, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4582670', 'n_tokens_mistral': 983, 'n_tokens_neox': 883, 'n_words': 197}