{"id":484,"date":"2017-11-08T22:44:04","date_gmt":"2017-11-09T01:44:04","guid":{"rendered":"https:\/\/maurobernal.com.ar\/blog\/?p=484"},"modified":"2021-06-25T23:22:17","modified_gmt":"2021-06-26T02:22:17","slug":"validar-tarjeta-de-credito-con-tsql","status":"publish","type":"post","link":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/","title":{"rendered":"Validar Tarjeta de Cr\u00e9dito con TSQL"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Validar Tarjeta de cr\u00e9dito<\/h2>\n\n\n\n<p><strong>Verificar y validar el n\u00famero de una Tarjeta de Cr\u00e9dito o D\u00e9bito<\/strong><br>La mayor\u00eda de los sellos de tarjetas de cr\u00e9dito (Visa, Master, Dinners, etc) usan el algoritmo de <strong>Luhn<\/strong>, el cual mediante un digito verificador corrobora si el resto de los n\u00fameros son correctos.<br><a href=\"https:\/\/es.wikipedia.org\/wiki\/Algoritmo_de_Luhn\" target=\"_blank\" rel=\"noopener\">https:\/\/es.wikipedia.org\/wiki\/Algoritmo_de_Luhn<\/a><\/p>\n\n\n\n<p>Existen diferentes formas de implementar el algoritmo. En esta ocasi\u00f3n les comparto el script de Derek Colley<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Veamos la funci\u00f3n para validar con TSQL<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted lang:tsql decode:true\">CREATE FUNCTION dbo.usp_LuhnsAlgorithm_New ( @inputString VARCHAR(20) )\nRETURNS TINYINT \nAS BEGIN \n-------------------------------------------------------------------------------\n-- Function to calculate whether a number is valid according to the 'MOD 10'\n-- check, a.k.a. Luhn's Algorithm.\n-- Author:  Derek Colley, August 2014\n-- Parameters:  @inputString VARCHAR(20) \n-- Outputs:  TINYINT:    2 = an error occurred, validity undetermined\n--       0 = number is not valid \n--       1 = number is valid\n-------------------------------------------------------------------------------\n\n-- first a quick check to ensure we have at least 3 numbers in the string - \n-- you can change this to any arbitrary amount, i.e. if you are just \n-- checking credit card numbers, make it 13 digits\n\nDECLARE @result TINYINT\n\nIF @inputString NOT LIKE ('%[0-9]%[0-9]%[0-9]%') \n RETURN 2\n\n-- set up our table for algorithm calculation\n\nDECLARE @charTable TABLE ( \n Position INT NOT NULL, \n ThisChar CHAR(1) NOT NULL, \n Doubled TINYINT, \n Summed TINYINT ) \n\n-- convert the @inputString to a fixed width char datatype \n-- we can then process the string as a set with a known number of elements\n-- this avoids RBAR substringing each char to a table in a cursor\n\nSET @inputString = CAST(@inputString AS CHAR(20))\nINSERT INTO @charTable(Position, ThisChar) \n SELECT 1, SUBSTRING(@inputString, 1, 1) UNION ALL \n SELECT 2, SUBSTRING(@inputString, 2, 1) UNION ALL \n SELECT 3, SUBSTRING(@inputString, 3, 1) UNION ALL \n SELECT 4, SUBSTRING(@inputString, 4, 1) UNION ALL \n SELECT 5, SUBSTRING(@inputString, 5, 1) UNION ALL \n SELECT 6, SUBSTRING(@inputString, 6, 1) UNION ALL \n SELECT 7, SUBSTRING(@inputString, 7, 1) UNION ALL \n SELECT 8, SUBSTRING(@inputString, 8, 1) UNION ALL \n SELECT 9, SUBSTRING(@inputString, 9, 1) UNION ALL \n SELECT 10, SUBSTRING(@inputString, 10, 1) UNION ALL \n SELECT 11, SUBSTRING(@inputString, 11, 1) UNION ALL \n SELECT 12, SUBSTRING(@inputString, 12, 1) UNION ALL \n SELECT 13, SUBSTRING(@inputString, 13, 1) UNION ALL \n SELECT 14, SUBSTRING(@inputString, 14, 1) UNION ALL \n SELECT 15, SUBSTRING(@inputString, 15, 1) UNION ALL \n SELECT 16, SUBSTRING(@inputString, 16, 1) UNION ALL \n SELECT 17, SUBSTRING(@inputString, 17, 1) UNION ALL \n SELECT 18, SUBSTRING(@inputString, 18, 1) UNION ALL \n SELECT 19, SUBSTRING(@inputString, 19, 1) UNION ALL \n SELECT 20, SUBSTRING(@inputString, 20, 1)\n\n\n-- remove non-numerics inc. whitespace from the string \nDELETE FROM @charTable\nWHERE  ThisChar NOT LIKE('[0-9]') \n\n\n-- unfortunately this messes up the Position indicator, \n-- so let's 'reset' this like so... \nDECLARE @tempTable TABLE ( \n NewPosition INT IDENTITY(1,1), \n OldPosition INT ) \nINSERT INTO @tempTable (OldPosition)\n SELECT Position \n FROM @charTable \n ORDER BY Position ASC \n\nUPDATE  @charTable\nSET   Position = t2.NewPosition \nFROM  @charTable t1 \nINNER JOIN  @tempTable t2 ON t1.Position = t2.OldPosition \n\n-- now for every 2nd digit from the right of the numeric, \n-- double it and store the result in the Doubled column \n\nIF ( SELECT MAX(Position) % 2 FROM @charTable ) = 0 -- evens \nBEGIN \n UPDATE @charTable\n SET  Doubled = CAST(ThisChar AS TINYINT) * 2 \n WHERE Position % 2 &lt;&gt; 0 \nEND\nELSE BEGIN -- odds\n UPDATE @charTable \n SET  Doubled = CAST(ThisChar AS TINYINT) * 2 \n WHERE Position % 2 = 0 \nEND \n\n\n-- now if the doubled digit is &gt; 9, sum the digits, else carry forward\n-- to the Summed column.  This goes for non-doubled digits too.\nUPDATE @charTable\nSET  Summed = \n   CASE WHEN Doubled IS NULL \n     THEN CAST(ThisChar AS TINYINT) \n     WHEN Doubled IS NOT NULL AND Doubled &lt;= 9 \n     THEN Doubled \n     WHEN Doubled IS NOT NULL AND Doubled &gt;= 10 \n     -- sum the digits.  Luckily SQL Server butchers int division...\n     THEN (Doubled \/ 10) + (Doubled - 10) \n   END      \n\n\n-- finally, sum the Summed column and if the result % 10 = 0, it's valid \nIF ( SELECT SUM(Summed) % 10 FROM @charTable ) = 0\n SET @result = 1\nELSE \n SET @result = 0\n\nRETURN @result \nEND<\/pre>\n\n\n\n<p>Para probar:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted lang:tsql decode:true\">SELECT '371449635398431' [Test String], [dbo].[usp_LuhnsAlgorithm_New]('371449635398431') [Valid Card?] UNION ALL\nSELECT '3714 4963 5398 431' [Test String], [dbo].[usp_LuhnsAlgorithm_New]('3714 4963 5398 431') [Valid Card?] UNION ALL\nSELECT '37XX XXXX 5398431' [Test String], [dbo].[usp_LuhnsAlgorithm_New]('37XX XXXX 5398431') [Valid Card?] UNION ALL\nSELECT 'This is not a valid string' [Test String], [dbo].[usp_LuhnsAlgorithm_New]('This is not a valid string' ) [Valid Card?] UNION ALL\nSELECT '1234123412341234' [Test String], [dbo].[usp_LuhnsAlgorithm_New]('1234123412341234') [Valid Card?]<\/pre>\n\n\n\n<p>Fuente:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.mssqltips.com\/sqlservertip\/3319\/implementing-luhns-algorithm-in-tsql-to-validate-credit-card-numbers\/\">https:\/\/www.mssqltips.com\/sqlservertip\/3319\/implementing-luhns-algorithm-in-tsql-to-validate-credit-card-numbers\/<\/a><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"91\" src=\"https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card-300x91.png?resize=300%2C91&#038;ssl=1\" alt=\"Validar tarjeta de credito con tsql\" class=\"wp-image-485\" srcset=\"https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card.png?resize=300%2C91&amp;ssl=1 300w, https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card.png?resize=768%2C232&amp;ssl=1 768w, https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card.png?resize=705%2C213&amp;ssl=1 705w, https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card.png?resize=450%2C136&amp;ssl=1 450w, https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card.png?w=798&amp;ssl=1 798w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Validar Tarjeta de cr\u00e9dito Verificar y validar el n\u00famero de una Tarjeta de Cr\u00e9dito o D\u00e9bitoLa mayor\u00eda de los sellos de tarjetas de cr\u00e9dito (Visa, Master, Dinners, etc) usan el&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,3],"tags":[124,123,125,33,128,29,127,126],"class_list":["post-484","post","type-post","status-publish","format-standard","hentry","category-mssql","category-t-sql","tag-card","tag-credit","tag-luhn","tag-master","tag-tarjeta-de-credito","tag-tsql","tag-validar","tag-visa"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Validar Tarjeta de Cr\u00e9dito con TSQL &#183; devops Mauro Bernal<\/title>\n<meta name=\"description\" content=\"TSQL para validar tarjeta de cr\u00e9dito (bin) con el algoritmo de Luhn\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Validar Tarjeta de Cr\u00e9dito con TSQL &#183; devops Mauro Bernal\" \/>\n<meta property=\"og:description\" content=\"TSQL para validar tarjeta de cr\u00e9dito (bin) con el algoritmo de Luhn\" \/>\n<meta property=\"og:url\" content=\"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/\" \/>\n<meta property=\"og:site_name\" content=\"devops Mauro Bernal\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-09T01:44:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-26T02:22:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card-300x91.png\" \/>\n<meta name=\"author\" content=\"Mauro Bernal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@_maurobernal\" \/>\n<meta name=\"twitter:site\" content=\"@_maurobernal\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mauro Bernal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/\"},\"author\":{\"name\":\"Mauro Bernal\",\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/#\\\/schema\\\/person\\\/09c4dbdfb59b20e015c703fd19713283\"},\"headline\":\"Validar Tarjeta de Cr\u00e9dito con TSQL\",\"datePublished\":\"2017-11-09T01:44:04+00:00\",\"dateModified\":\"2021-06-26T02:22:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/\"},\"wordCount\":106,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/#\\\/schema\\\/person\\\/09c4dbdfb59b20e015c703fd19713283\"},\"image\":{\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/validar_credit_card-300x91.png\",\"keywords\":[\"card\",\"credit\",\"luhn\",\"master\",\"tarjeta de credito\",\"tsql\",\"validar\",\"visa\"],\"articleSection\":[\"MSSQL\",\"T-SQL\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/\",\"url\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/\",\"name\":\"Validar Tarjeta de Cr\u00e9dito con TSQL &#183; devops Mauro Bernal\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/validar_credit_card-300x91.png\",\"datePublished\":\"2017-11-09T01:44:04+00:00\",\"dateModified\":\"2021-06-26T02:22:17+00:00\",\"description\":\"TSQL para validar tarjeta de cr\u00e9dito (bin) con el algoritmo de Luhn\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/maurobernal.com.ar\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/validar_credit_card.png?fit=798%2C241&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/maurobernal.com.ar\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/validar_credit_card.png?fit=798%2C241&ssl=1\",\"width\":798,\"height\":241},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/validar-tarjeta-de-credito-con-tsql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Validar Tarjeta de Cr\u00e9dito con TSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/\",\"name\":\"devops Mauro Bernal\",\"description\":\"Cuando tu trabajo es hacer que las cosas funcionen bien...\",\"publisher\":{\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/#\\\/schema\\\/person\\\/09c4dbdfb59b20e015c703fd19713283\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/maurobernal.com.ar\\\/blog\\\/#\\\/schema\\\/person\\\/09c4dbdfb59b20e015c703fd19713283\",\"name\":\"Mauro Bernal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/i0.wp.com\\\/maurobernal.com.ar\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo-maurobernal.png?fit=1740%2C1740&ssl=1\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/maurobernal.com.ar\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo-maurobernal.png?fit=1740%2C1740&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/maurobernal.com.ar\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo-maurobernal.png?fit=1740%2C1740&ssl=1\",\"width\":1740,\"height\":1740,\"caption\":\"Mauro Bernal\"},\"logo\":{\"@id\":\"https:\\\/\\\/i0.wp.com\\\/maurobernal.com.ar\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo-maurobernal.png?fit=1740%2C1740&ssl=1\"},\"description\":\"Desarrollo de Sistemas en .Net, IT Callcenters, DBA de SQL Server, Mikrotik, Pentest y T\u00e9cnico consultor de Sistemas Bejerman\",\"sameAs\":[\"https:\\\/\\\/maurobernal.com.ar\",\"https:\\\/\\\/x.com\\\/_maurobernal\",\"https:\\\/\\\/youtube.com\\\/maurobernal\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Validar Tarjeta de Cr\u00e9dito con TSQL &#183; devops Mauro Bernal","description":"TSQL para validar tarjeta de cr\u00e9dito (bin) con el algoritmo de Luhn","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/","og_locale":"es_ES","og_type":"article","og_title":"Validar Tarjeta de Cr\u00e9dito con TSQL &#183; devops Mauro Bernal","og_description":"TSQL para validar tarjeta de cr\u00e9dito (bin) con el algoritmo de Luhn","og_url":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/","og_site_name":"devops Mauro Bernal","article_published_time":"2017-11-09T01:44:04+00:00","article_modified_time":"2021-06-26T02:22:17+00:00","og_image":[{"url":"https:\/\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card-300x91.png","type":"","width":"","height":""}],"author":"Mauro Bernal","twitter_card":"summary_large_image","twitter_creator":"@_maurobernal","twitter_site":"@_maurobernal","twitter_misc":{"Escrito por":"Mauro Bernal","Tiempo de lectura":"4 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/#article","isPartOf":{"@id":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/"},"author":{"name":"Mauro Bernal","@id":"https:\/\/maurobernal.com.ar\/blog\/#\/schema\/person\/09c4dbdfb59b20e015c703fd19713283"},"headline":"Validar Tarjeta de Cr\u00e9dito con TSQL","datePublished":"2017-11-09T01:44:04+00:00","dateModified":"2021-06-26T02:22:17+00:00","mainEntityOfPage":{"@id":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/"},"wordCount":106,"commentCount":3,"publisher":{"@id":"https:\/\/maurobernal.com.ar\/blog\/#\/schema\/person\/09c4dbdfb59b20e015c703fd19713283"},"image":{"@id":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/#primaryimage"},"thumbnailUrl":"https:\/\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card-300x91.png","keywords":["card","credit","luhn","master","tarjeta de credito","tsql","validar","visa"],"articleSection":["MSSQL","T-SQL"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/","url":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/","name":"Validar Tarjeta de Cr\u00e9dito con TSQL &#183; devops Mauro Bernal","isPartOf":{"@id":"https:\/\/maurobernal.com.ar\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/#primaryimage"},"image":{"@id":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/#primaryimage"},"thumbnailUrl":"https:\/\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card-300x91.png","datePublished":"2017-11-09T01:44:04+00:00","dateModified":"2021-06-26T02:22:17+00:00","description":"TSQL para validar tarjeta de cr\u00e9dito (bin) con el algoritmo de Luhn","breadcrumb":{"@id":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/#primaryimage","url":"https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card.png?fit=798%2C241&ssl=1","contentUrl":"https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2017\/11\/validar_credit_card.png?fit=798%2C241&ssl=1","width":798,"height":241},{"@type":"BreadcrumbList","@id":"https:\/\/maurobernal.com.ar\/blog\/validar-tarjeta-de-credito-con-tsql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/maurobernal.com.ar\/blog\/"},{"@type":"ListItem","position":2,"name":"Validar Tarjeta de Cr\u00e9dito con TSQL"}]},{"@type":"WebSite","@id":"https:\/\/maurobernal.com.ar\/blog\/#website","url":"https:\/\/maurobernal.com.ar\/blog\/","name":"devops Mauro Bernal","description":"Cuando tu trabajo es hacer que las cosas funcionen bien...","publisher":{"@id":"https:\/\/maurobernal.com.ar\/blog\/#\/schema\/person\/09c4dbdfb59b20e015c703fd19713283"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/maurobernal.com.ar\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":["Person","Organization"],"@id":"https:\/\/maurobernal.com.ar\/blog\/#\/schema\/person\/09c4dbdfb59b20e015c703fd19713283","name":"Mauro Bernal","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2023\/07\/logo-maurobernal.png?fit=1740%2C1740&ssl=1","url":"https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2023\/07\/logo-maurobernal.png?fit=1740%2C1740&ssl=1","contentUrl":"https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2023\/07\/logo-maurobernal.png?fit=1740%2C1740&ssl=1","width":1740,"height":1740,"caption":"Mauro Bernal"},"logo":{"@id":"https:\/\/i0.wp.com\/maurobernal.com.ar\/blog\/wp-content\/uploads\/2023\/07\/logo-maurobernal.png?fit=1740%2C1740&ssl=1"},"description":"Desarrollo de Sistemas en .Net, IT Callcenters, DBA de SQL Server, Mikrotik, Pentest y T\u00e9cnico consultor de Sistemas Bejerman","sameAs":["https:\/\/maurobernal.com.ar","https:\/\/x.com\/_maurobernal","https:\/\/youtube.com\/maurobernal"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/maurobernal.com.ar\/blog\/wp-json\/wp\/v2\/posts\/484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/maurobernal.com.ar\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/maurobernal.com.ar\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/maurobernal.com.ar\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/maurobernal.com.ar\/blog\/wp-json\/wp\/v2\/comments?post=484"}],"version-history":[{"count":7,"href":"https:\/\/maurobernal.com.ar\/blog\/wp-json\/wp\/v2\/posts\/484\/revisions"}],"predecessor-version":[{"id":851,"href":"https:\/\/maurobernal.com.ar\/blog\/wp-json\/wp\/v2\/posts\/484\/revisions\/851"}],"wp:attachment":[{"href":"https:\/\/maurobernal.com.ar\/blog\/wp-json\/wp\/v2\/media?parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maurobernal.com.ar\/blog\/wp-json\/wp\/v2\/categories?post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maurobernal.com.ar\/blog\/wp-json\/wp\/v2\/tags?post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}