{"id":15689821,"url":"https://github.com/benjaminch/pricers","last_synced_at":"2025-05-07T23:48:32.983Z","repository":{"id":57484968,"uuid":"112008341","full_name":"benjaminch/pricers","owner":"benjaminch","description":"This library supports RTB development for Open RTB common price encryption in Golang.","archived":false,"fork":false,"pushed_at":"2023-04-10T17:31:19.000Z","size":79,"stargazers_count":9,"open_issues_count":7,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T04:34:18.486Z","etag":null,"topics":["go","golang","golang-library","openrtb","price-encryption"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benjaminch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-25T14:08:24.000Z","updated_at":"2024-12-12T12:44:39.000Z","dependencies_parsed_at":"2023-07-13T11:31:31.526Z","dependency_job_id":null,"html_url":"https://github.com/benjaminch/pricers","commit_stats":null,"previous_names":["benjaminch/openrtb-pricers"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminch%2Fpricers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminch%2Fpricers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminch%2Fpricers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjaminch%2Fpricers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjaminch","download_url":"https://codeload.github.com/benjaminch/pricers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252973625,"owners_count":21834105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","golang-library","openrtb","price-encryption"],"created_at":"2024-10-03T18:04:39.034Z","updated_at":"2025-05-07T23:48:32.967Z","avatar_url":"https://github.com/benjaminch.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pricers\n[![Build Status](https://travis-ci.org/benjaminch/pricers.svg?branch=master)](https://travis-ci.org/benjaminch/pricers)\n[![GoDoc](https://godoc.org/github.com/benjaminch/pricers?status.svg)](https://godoc.org/github.com/benjaminch/pricers)\n[![Go Report Card](https://goreportcard.com/badge/github.com/benjaminch/pricers)](https://goreportcard.com/report/github.com/benjaminch/pricers)\n[![Maintainability](https://api.codeclimate.com/v1/badges/95e0f8491d86d90c6da6/maintainability)](https://codeclimate.com/github/benjaminch/pricers/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/95e0f8491d86d90c6da6/test_coverage)](https://codeclimate.com/github/benjaminch/pricers/test_coverage)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/benjaminch/pricers)\n![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/benjaminch/pricers)\n\n## Overview\nThis library supports RTB development for Open RTB common price encryption in Golang.\n\n## Installation\n```bash\n$ go get github.com/benjaminch/pricers\n```\n\n## Supported encryption protocols\n### Google Private Data\nSpecs https://developers.google.com/ad-exchange/rtb/response-guide/decrypt-price\n#### Examples\n##### Creating a new Google Private Data Pricer\n```golang\nimport \"github.com/benjaminch/pricers/doubleclick\"\n\nvar pricer *doubleclick.DoubleClickPricer\nvar err error\npricer, err = doubleclick.NewDoubleClickPricer(\n    \"ZS-DraBUUVeht_sMDgn1nnM3My_nq9TrEESbjubDkTU\",   // Encryption key\n    \"vQo9-4KtlcXmPhWaYvc8asqYuiSVMiGUdZ1RLXfrK7U\",   // Integrity key\n    true,                                            // Keys are base64\n    helpers.Utf8,                                    // Keys should be ingested as Utf-8\n    1000000,                                         // Price scale Factor Micro\n    false,                                           // No debug\n)\n```\n##### Encrypting a clear price\n```go\nimport \"github.com/benjaminch/pricers/doubleclick\"\n\nvar result string\nvar err error\nprice := 42 // Clear price\nseed := \"\"\nresult, err = pricer.Encrypt(seed, price)\nif err != nil {\n    err = errors.New(\"Encryption failed. Error : %s\", err)\n}\n```\n##### Decrypting an encrypted price\n```go\nimport \"github.com/benjaminch/pricers/doubleclick\"\n\nvar result float64\nvar err error\nencryptedPrice := \"WEp8nQAAAAADG-y45xxIC1tMWuTjzmDW6HtroQ\"\nresult, err = pricer.Decrypt(encryptedPrice)\nif err != nil {\n    err = errors.New(\"Decryption failed. Error : %s\", err)\n}\n```\n## Todos\n- [ ] Re-organize directory layout following https://github.com/golang-standards/project-layout\n- [ ] Complete documentation:\n  - [ ] How to use the Pricer Builder (describing all params)\n  - [ ] How to use the Pricer Encrypt function (describing all params)\n  - [ ] How to use the Pricer Decrypt function (describing all params)\n- [ ] Complete tests for helpers\n- [ ] Complete tests for Google Private Data, including various key formats (hex, utf8, base64, etc.)\n- [ ] Add other most common price encryption protocols (AES, etc.)\n   - [ ] BlowFish\n   - [ ] Symetric Algorithm\n   - [ ] XOR\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminch%2Fpricers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjaminch%2Fpricers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminch%2Fpricers/lists"}